home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1988 April / Ahoy_Magazine_88-04_1988_Double_L.d64 / Time Machine 2 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  714b  |  21 lines

  1. 0 print"[147]"tab(13)"time machine"
  2. 1 rem =================================
  3. 2 rem    commodares problem #48-3 :
  4. 3 rem      time machine
  5. 4 rem    solution by
  6. 5 rem      jim speers
  7. 6 rem =================================
  8. 100 print"12[146] or 24[146] hour time?": input tm: if tm<>12 and tm<>24 then 100
  9. 110 b=1: e=12: f=720: if tm=24 then b=0: e=23: f=1440
  10. 120 print"[147]present time:[146]": (NULL)"0,.$"
  11. 130 print"hour";: input h: if h<b or h>e then 130
  12. 140 print"minute";: input m: if m<0 or m>59 then 140
  13. 150 tm=h*60+m: print"time difference(min)";: input d: t1=tm-d: t2=tm+d
  14. 160 if t1<0 then t1=t1+f: goto 160
  15. 170 if t2>f then t2=t2-f: goto 170
  16. 180 x=t1: gosub 200: print (NULL)"##:##";hr,mn
  17. 190 x=t2: gosub 200: print (NULL)"##:##";hr,mn: end
  18. 200 hr=int(x/60): mn=x-60*hr: if hr=0 and de=12 then hr=12
  19. 205 if hr=24 and e=23 then hr=0
  20. 210 return
  21.